home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
4_6.lha
/
4_6
/
timen.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
624b
|
28 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
include <stream.h>
include <sys/types.h>
include <sys/times.h>
truct tms sv_time0, sv_time1;
oid time0()
(void) times(&sv_time0);
xtern int printing;
oid time1(char *place)
(void) times(&sv_time1);
if (printing & 2)
cout << place << " at: usr=" << sv_time1.tms_utime - sv_time0.tms_utime <<
",\tsys=" << sv_time1.tms_stime - sv_time0.tms_stime <<
"\ttot=" << sv_time1.tms_stime - sv_time0.tms_stime +
sv_time1.tms_utime - sv_time0.tms_utime <<
"\n";